<script>

function fact(n,ret) {
  if (n == 0)
    ret(1) ;
  else
    fact(n-1, function (t0) {
     ret(n * t0) }) ;
}

alert( fact(5 , function( n ) { console.dir(n)} ))
</script>
